<?
	
	class loginAction extends Action {
		
		
		public function login(){
			$this->display();
		}
		
		public function checklogin(){
			$username = safeRequest($_POST["username"],1);
			$password = md5(safeRequest($_POST["password"],1));
			$dao = D("adminuser");
			$record = $dao->find("username='$username' and password='$password'");
			if($record){
				Session::set("adminInfo",$record);
				$this->redirect("index","index");
			}else{
				$this->error("错误的用户名或密码，你可以重试。");
			}
		}
		
		public function checkcode(){
			import("ORG.Util.Image");
			Image::buildImageVerify();
		}
		
	}
?>